1. Field of the Invention
The present invention relates to a coding method and a recording and reproducing apparatus, and is for example, preferable for compressing and coding, recording, decoding, and reproducing a moving image signal.
2. Description of the Related Art
Conventionally, in the case where a moving image signal is transmitted to a remote place in a video conference system or a video telephone system or the like, the image signal is compressed and coded by using line correlation and frame correlation for effective use of the transmission path. The similar method is applied to a video recording and reproducing system using a recording media, such as a hard disk, and an MO disk for increasing a recording time per unit capacity. For example, when frame correlation is used, the amount of information can be compressed by performing orthogonal conversion such as discrete cosine transform (DCT) to an image signal with respect to a macro block which is divided from a frame screen and quantizing it.
In the compression coding of a moving image signal using such correlation between frames, one compression sequence can be completed in an image frame unit which is referred to as a GOP (Group of Pictures).
For example, when a GOP comprises two frame units, one sequence is completed by compressing and coding the images in the two frames in the form of an I-picture and a B-picture. When a GOP comprises four frame units, one compression sequence is completed by compressing and coding the images in the four frames into an I-picture, a B-picture and a P-picture.
The I-picture represents an image frame coded as it is by using, for example, the DCT (Discrete Cosine Transform) coding. The B-picture represents an image frame which is decoded by prediction between frames using a frame present in the forward and backward bidirections. The P-picture represents an image frame which is decoded by prediction between frames using a frame which is present in one direction.
Generally, the images in frames adjacent in time do not show a large change. Therefore, the I-picture is used as a reference frame image, and the B- and P-pictures are formed by extracting the differences from the I-picture. At the time of decoding, parts other than the differences are interpolated by prediction using both the forward and backward direction by using the I-picture as a reference image. In this manner, a video signal can be efficiently compressed and coded. Incidentally, since the B-picture and the P-picture can be decoded by prediction using the I-picture, one I-picture must be present without fail in one GOP.
Furthermore, since the B-picture is decoded by prediction based on a both forward and backward direction frame and the P-picture is decoded by prediction based on a one direction frame respectively, the I-picture must be restored first into each image frame in the compressed and coded GOP.
Here, in the compressed moving image data, the frame order is replaced because the image data is restored in the order of transmission and recording.
For example, as shown in FIG. 1, in one GOP unit which formed of four subsequent image frames, with respect to each of the image frames, which are input in the order of frame A1, frame A2, frame A3 and frame A4, the frame order of each image frame is replaced in accordance with the coding form which is used in the compression coding. Here, frames A1 and A3 represent image frames which are coded in the B-picture, frame A2 represents an image frame coded in the I-picture. Frame A4 represents an image frame coded in the P-picture.
The image frames, which are input in the order of frame A1, frame A2 and frame A3, and frame A4 are rearranged into the order of frame A2, frame A1, frame A4 and frame A3 at the time of the coding process. Each image frame which is coded and transmitted or recorded is rearranged back into the original order at the time of decoding.
In other words, since the image frames, which have been rearranged into the order of frame A2, frame A1, frame A4 and frame A3, are decoded in the order of transmission and recording, frame A2 (which comprises the I-picture) is decoded first followed by the decoding of frame A1 (comprising the B-picture) on the basis of the decoding of frame A2. Then frame A4 (which comprises the P-picture) is decoded on the basis of frame A2, and lastly, frame A3 is decoded on the basis of frame A1 and frame A4. Each of the image frames decoded in this manner are replaced back into the original image frame order at the time of decoding and are displayed on a monitor or the like.
In this manner, each image frame is replaced immediately after or soon after the image frame which constitutes the reference for prediction at the time of coding so that each image frame is transmitted and recorded with the result that the image frame which constitutes an object can be decoded immediately after the image frame which constitutes the reference is decoded at the time of decoding. Consequently, the time required for the decoding process can be shortened, thereby avoiding a delay in the image display.
In the compression coding of a moving image signal using correlation between frames, each image frame is compressed and coded for each GOP unit by a technique such that the editing of image frames for one GOP unit and the random access for one GOP unit are enabled from the compression moving image data.
By the way, in the compressed video data which has coded for every GOP units, such as GOP sequence information showing that each frame before coded is coded in which of I-, B-, or P-picture, and which corresponds to what number of frame in GOP, is added.
These information are referred at the time of decoding, but they are not needed after decoding in general.
On dubbing, however, in the case where a moving image signal passed through compression coding/decoding process is compressed and coded again by using a similar compression algorithm, in view of frames of a moving image, differences are appeared in image quality after dubbing in accordance with that whether the relative position of a frame in one GOP sequence is the same or not at the first and the second compressing and coding. As to image quality after dubbing, the deterioration of image-quality can be suppressed extremely when the first and the second correspondence relations of a moving image being an original image and the GOP sequence are coincided with each other.
Therefore, it is good to add the moving image signal passed through compression coding and decoding, the GOP sequence information which has used at this time and transmit it, and when it is compressed again by a dubbing device, it is good to compress the moving image with referring to the transmitted GOP sequence information so as to correspond to the GOP sequence at the last time.
The transmitting format of an image signal, however, is so constituted that GOP sequence information cannot be transmitted in general, thus there is a problem that GOP sequence information cannot be transmitted for improving image quality on dubbing.